<div class="container-fluid">
  <div class="row">
    <div class="col-md-12">
      <div class="card card-query">
        <div class="content">
          <div class="row">
            <div class="col-md-6">
              <h4 class="card-title">用户电话</h4>
              <div class="form-group">
                <input type="text" ng-model="query.phone" class="form-control" placeholder="输入用户电话">
              </div>
            </div>
            <div class="col-md-6">
              <h4 class="card-title">用户名称</h4>
              <div class="input-group">
                <input type="text" ng-model="query.name" class="form-control" placeholder="输入用户名称">
                <span class="input-group-btn">
                  <button type="button" class="btn btn-info" ng-click="queryUsers()">搜索</button>
                  <button type="button" class="btn btn-info" ng-click="openModal()">创建</button>
                </span>
              </div>
            </div>
          </div>
          <div ng-pagination ng-model="total" changed="queryUsers" param="query"></div>  
        </div>
      </div>
    </div>
  </div>

  <div class="row">
    <div class="col-lg-3 col-sm-6" ng-repeat="item in data">
      <div class="card card-person">
        <div class="content">
          <div class="row">
            <div class="col-xs-7">
              <span class="label label-primary"><i class="ti-user"></i> {{item.name}}</span><br/>
              <span class="label label-danger"><i class="ti-user"></i>{{item.phone}}</span><br/>
              <span class="label label-warning"><i class="ti-pencil"></i> {{item.lastUpdateTime}}</span>
            </div>
            <div class="col-xs-5">
                <image class="avatar border-white" src="{{item.avatar}}"></image>
            </div>
          </div>
          <div class="footer text-right">
            <hr />
            <button type="button" class="btn btn-xs btn-success" ng-click="openModal(item.id)"><i class="glyphicon glyphicon-edit"></i>编辑</button>
            <button type="button" class="btn btn-xs btn-success" ng-click="deleteUser(item.id)"><i class="glyphicon glyphicon-search"></i>删除</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>


<script type="text/ng-template" id="user-edit.html">
<div class="modal-header">
  <h3 class="modal-title">{{modalTitle}}</h3>
</div>
<div class="modal-body">
  <form role="form" novalidate name="editForm">
	<div class="form-group" ng-class="{'has-error':editForm.account.$error.required}">
      	<label class="control-label">登录账户</label> 
      	<input type="text" placeholder="登录账户" class="form-control" name="account" ng-model="formdata.account" required></input>
   	</div>
	<div class="form-group" ng-class="{'has-error':editForm.pwd.$error.required}">
      	<label class="control-label">登录密码</label> 
      	<input type="password" placeholder="登录密码" class="form-control" name="pwd" ng-model="formdata.pwd" required></input>
   	</div>
 	<div class="form-group" ng-class="{'has-error':editForm.name.$error.required}">
      	<label class="control-label">姓名</label> 
      	<input type="text" placeholder="姓名" class="form-control" name="name" ng-model="formdata.name" required></input>
   	</div>
    <div class="form-group">
      	<label class="control-label">性别</label> 
		<div>
			<label class="radio-inline"> 
				<input ng-icheck type="radio" ng-model="formdata.sex" value="0" /> 女
			</label>
			<label class="radio-inline"> 
				<input ng-icheck type="radio" ng-model="formdata.sex" value="1" /> 男
			</label>
		</div>
   	</div>
   	<div class="form-group">
      	<label class="control-label">电话</label> 
      	<input type="text" placeholder="电话" class="form-control" ng-model="formdata.phone"></input>
   	</div>
	<div class="form-group">
      	<label class="control-label">email</label> 
      	<input type="text" placeholder="email" class="form-control" ng-model="formdata.email"></input>
   	</div>
	<div class="form-group">
      	<label class="control-label">备注</label> 
		<textarea placeholder="备注" class="form-control" ng-model="formdata.remark" rows="3"></textarea>
   	</div>

  </form>
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-primary" ng-click="cancel()">取消</button>
  <button type="button" class="btn btn-warning" ng-disabled="editForm.$invalid" ng-click="ok()">确定</button>
</div>
</script>
<thead>
  <tr>
    <th ng-repeat="col in config.colModels" width="{{col.width}}"
      ng-class="{'sorting':config.sortName!=col.index,'sorting_asc':config.sortName==col.index && config.sortOrder=='asc','sorting_desc':config.sortName==col.index && config.sortOrder=='desc'}"
      ng-click=sortChange(col.index)>{{col.name}}</th>
  </tr>
</thead>
<tbody>
  <tr ng-repeat="row in data.data track by $index">
    <td ng-repeat="col in config.colModels track by $index">{{row[col.index]}}</td>
  </tr>
</tbody>
